@inherits BaseComponent

@namespace FluentCMS.Web.Plugins.Admin.FileManagement

@if (Visible && Model != null)
{
    <EditForm Model="@Model" OnSubmit="HandleSubmit">
    <Modal Size="ModalSize.Large" OnClose="HandleCancel">
        <ModalHeader Closable>
            <ModalTitle>
                Rename Folder
            </ModalTitle>
        </ModalHeader>
        <ModalBody>
            <DataAnnotationsValidator />
            <Grid>
                <FormInput @bind-Value="Model.Name" Label="Name" Placeholder="Enter Folder Name" Required />
            </Grid>
            <Alert Visible="Errors.Count > 0" Type="AlertType.Danger">
                @foreach (var error in Errors)
                    {
                        <p>@error</p>
                    }
                </Alert>
            </ModalBody>
            <ModalFooter>
                <FormActions>
                    <Button Color="Color.Primary" Type="ButtonType.Submit">
                        Submit
                    </Button>

                    <Button @onclick="HandleCancel">
                        Cancel
                    </Button>
                </FormActions>
            </ModalFooter>
        </Modal>
    </EditForm>
}
